﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}
@section css {
    <link href="~/Assets/css/previewImage.css" rel="stylesheet" />
    <link href="~/Assets/css/mui.picker.min.css" rel="stylesheet" />
    <script src="~/Assets/js/mui.picker.js"></script>
    <script src="~/Assets/js/mui.picker.min.js"></script>
    <script src="~/Assets/js/mui.dtpicker.js"></script>
    <style>
        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }

        .btn_addPic {
            display: block;
            position: relative;
            width: 53px;
            height: 53px;
            overflow: hidden;
            cursor: pointer;
            text-align: center;
        }

        .filePrew {
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            width: 53px;
            height: 53px;
            opacity: 0;
        }
    </style>
}
<header class="mui-bar mui-bar-nav">
    <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left" style="color:white;">
        <span class="mui-icon mui-icon-left-nav" style=""></span>
    </button>
    <h1 class="mui-title" style="color:white;">添加整改措施</h1>
</header>

<div class="mui-content" style="margin: 5px;" ng-cloak ng-controller="HiddenTroubleController" ng-init="
     FormId='@(Request.QueryString["FormId"].IsEmpty() ? "0" : Request.QueryString["FormId"])';
     ImageCount=[0,1,2];
     InitDatePicker('#datetime');
     AddModel={};
     FileList=[];
     AddModel.IsTemporary=0;
     AddModel.PlanCompleteTime = '@DateTime.Now.AddDays(7).ToString("yyyy-MM-dd")';
     AddModel.DepartmentId='0';
     GetEquTypeList();
     GetDepartmentList();
     ">
    <form class="mui-input-group">
        <div class="mui-input-row mui-radio mui-left">
            <label>立即整改</label>
            <input name="radio1" type="radio" ng-click="AddModel.IsTemporary=0" value="" checked>
        </div>
        <div class="mui-input-row mui-radio mui-left">
            <label>临时措施</label>
            <input name="radio1" type="radio" ng-click="AddModel.IsTemporary=1">
        </div>
    </form>
    <form class="mui-input-group" style="margin-top:10px;">
        <div class="mui-input-row">
            <label>设施设备类型</label>
            <select ng-model="AddModel.EquType" ng-change="GetMaintanceDep(AddModel.EquType,AddModel);">
                <option value="" selected>请选择设施设备类型</option>
                <option value="0">非设施设备类问题</option>
                <option ng-repeat="x in EquTypeList" value="{{x.Id}}">{{x.TypeName}}</option>
            </select>
        </div>
        <div class="mui-input-row">
            <label>维保部门</label>
            <select ng-model="AddModel.DepartmentId" ng-disabled="AddModel.EquType==''||AddModel.EquType=='0'||AddModel.EquType==null" ng-change="" class="form-control">
                <option value="" selected>请选择维保部门</option>
                <option ng-repeat="x in DepartmentList" value="{{x.Id}}">{{x.DepartmentName}}</option>
            </select>
        </div>
    </form>
    <form class="mui-input-group" style="margin-top:10px;">
        <div class="mui-input-row">
            <label>计划完成时间</label>
            <input type="text" id="datetime" data-options='{"type":"date"}' ng-model="AddModel.PlanCompleteTime" readonly />
        </div>
        <div class="mui-input-row">
            <label>联系部门</label>
            <input type="text" ng-model="AddModel.DepartmentName" placeholder="填写联系部门" />
        </div>
        <div class="mui-input-row">
            <label>联系人</label>
            <input type="text" ng-model="AddModel.Responsible" placeholder="填写联系联系人" />
        </div>
    </form>
    <div class="mui-input-row" style="margin: 10px 5px;">
        <textarea id="textarea" rows="5" placeholder="填写整改措施" ng-model="AddModel.SolutionContent"></textarea>
    </div>

    <p>添加照片</p>
    <div class="row image-list" style="margin-top:20px;margin-bottom:50px;display:none;">
        <div style="float:left;margin-left:10px;" ng-repeat="x in ImageCount" id="imagebox_{{x}}">

        </div>
    </div>
    <div class="row image-list">
        <img id="upload_{{x}}" ng-repeat="x in ImageCount" ng-click="InitLxUpload('upload_',x,'HiddenTroubleSolution');" src="../../Assets/img/upload.png" class="img-item space" style="width:55px;height:auto;margin:5px;" alt="" title="">
    </div>
    <div class="mui-button-row" style="margin-top:150px;">
        <button type="button" ng-click="AddSolutionForm(AddModel,FormId);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">保 &nbsp;&nbsp;存</button>
    </div>
    <div style="height:80px;"></div>
</div>
@section js{
    <script src="~/Assets/js/base/app-jssdk.umd.min.js"></script>
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/mui.zoom.js"></script>
    <script src="~/Assets/js/mui.previewimage.js"></script>
    <script src="~/Assets/js/pg/MHiddenTrouble.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>
    <script>

        mui.showLoading("正在加载..", "div");

        setTimeout(function () {
            mui.hideLoading();
            mui.previewImage();
        }, 2000);
    </script>
}
